<% _admin_menu_draw = admin_menu_draw %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><%= raw cama_admin_title_draw %></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <%= stylesheet_link_tag "camaleon_cms/admin/admin-manifest", media: "all" %>
    <script>
        var root_url = '<%= cama_root_url(locale: nil) %>';
        var root_admin_url = '<%= cama_admin_url(locale: nil) %>';
        var NO_IMAGE_URL = '<%= asset_url("camaleon_cms/image-not-found.png") %>';
        var CURRENT_LOCALE = '<%= current_locale %>';
        var ADMIN_TRANSLATIONS = <%= raw current_site.get_languages.to_json %>;
        var tinymce_global_settings = {language_url: "<%= asset_path("camaleon_cms/admin/tinymce/langs/#{current_locale}.js") %>", custom_css: [], custom_toolbar: [], post_render: [], init: [], setups: [], settings: []};
        var I18n_data = <%= I18n.backend.respond_to?(:translations) ? I18n.backend.send(:translations)[current_locale.to_sym][:camaleon_cms][:admin][:js].to_json.html_safe : !!(I18n.backend.backends[1] && I18n.backend.backends[1].backends[1]) ? I18n.backend.backends[1].backends[1].send(:translations)[current_locale.to_sym][:camaleon_cms][:admin][:js].to_json.html_safe : "{}" rescue "{}" %>
    </script>
    <%= javascript_include_tag "camaleon_cms/admin/admin-manifest" %>

    <%= javascript_include_tag "camaleon_cms/admin/jquery_validate/messages_#{current_locale}.js" if current_locale != 'en' %>

    <% jquery_validate_localized_methods = "camaleon_cms/admin/jquery_validate/methods_#{current_locale}.js"%>
    <% jquery_validate_localized_methods_exist =
         File.file?(Rails.root.join('app', 'assets', 'javascripts', jquery_validate_localized_methods))%>
    <%= javascript_include_tag jquery_validate_localized_methods if jquery_validate_localized_methods_exist %>

    <%= javascript_include_tag "camaleon_cms/admin/momentjs/#{current_locale}.js" if current_locale != 'en' %>

    <%= raw the_head({}, false) %>
    <%= yield :head if content_for? :head %>
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini" data-intro="<%= current_site.get_option("save_intro") %>">
    <%= yield :before_content if content_for? :before_content %>
    <%= raw cama_content_before_draw %>
    <div class="wrapper">

        <%= render partial: "layouts/camaleon_cms/admin/header" %>
        <%= render partial: "layouts/camaleon_cms/admin/sidebar", locals: {_admin_menu_draw: _admin_menu_draw} %>

        <div class="content-wrapper">
            <!-- Main content -->
            <section class="content" id="admin_content">
                <ol class="breadcrumb"><%= render_breadcrumbs :tag => :li, :separator => "" %></ol>
                <%= render "camaleon_cms/flash_messages" %>
                <%= yield %>
            </section>
            <!-- /.content -->
        </div>

        <%= render partial: "layouts/camaleon_cms/admin/footer" %>
    </div>
    <%= raw cama_content_after_draw %>
    <%= yield :after_content if content_for? :after_content %>
</body>
</html>
